package cn.ustb.serviceImpl;

import cn.ustb.dao.LevelExamDao;
import cn.ustb.entity.LevelExam;
import cn.ustb.service.LevelExamService;
import cn.ustb.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author yuyan
 */
public class LevelExamServiceImpl implements LevelExamService {
    @Override
    public List<LevelExam> getAllWithYearTerm(String yearTerm) {
        SqlSession sqlSession = null;
        try{
            sqlSession = MyBatisUtil.getInstance();
            LevelExamDao levelExamDao = sqlSession.getMapper(LevelExamDao.class);
            return levelExamDao.getAllWithYearTerm(yearTerm);
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            if (sqlSession!=null){
                sqlSession.close();
            }
        }
        return null;
    }
}
